#!/usr/bin/perl -w 

$cfg_sqlim = "/usr/local/scripts/sqlim";

$cfg_mysql_host = "localhost";
$cfg_mysql_port = "3306";
$cfg_db='sqlim';
$cfg_user='sqlim';
$cfg_password='sqlim';

$cfg_access_log = "/var/log/squid/access.log";
$cfg_store_month = 12;
# if 1, basic auth password change facilty enabled 
$cfg_auth = 1;
# htpasswd file
$cfg_auth_file = "/etc/squid/squid.users";
# urls for sum by given domen
$cfg_root_url = "odnoklassniki.ru;vkontakte.ru;lenta.ru";
# traff in mb
$cfg_traff_mb = 1;
# read-only admins, only for stat
@cfg_ro_admins = ('bigboss',);

use DBI;

#$0=~m/^(.+)\/(cgi-bin\/)?[^\/]+$/;
#push @INC, $1;

push @INC, $cfg_sqlim;
require "util.pl";

$cfg_dsn = "DBI:mysql:database=$cfg_db;host=$cfg_mysql_host;port=$cfg_mysql_port";
$cfg_tpl_path = "$cfg_sqlim/tpl";
$cfg_pass_change = "$cfg_sqlim/pass_basic";
$cfg_pass_delete = "$cfg_sqlim/pass_basic_del";

#$s{"alexey"}{"love.rambler.ru"}=1;

###############################################################################
## utility functions
###############################################################################
sub db_connect {
my $dbh;
   
    $dbh=DBI->connect($cfg_dsn, $cfg_user, $cfg_password, {RaiseError => 1, AutoCommit => 1}) || die "Can't connect to database: $^E";
#    $dbh->do("set CHARACTER SET cp1251_koi8;");
    return $dbh;
}

1;
